set the visible of card field 1 to not the visible of card field 1
if the visible of card field 1 is true then
set the name of me to "Hide Pascal Source"
else set the name of me to "Show Pascal Source"
end mouseUp
-- part contents for background part 16
----- text -----
LEAFNAME XFCN version 1.5
Kevin Calhoun
LeafName takes a full pathname and returns the last component of it. The last component is the string of characters following the last colon in the pathname. This is known as the
"leaf name" of a file or directory.
Examples:
put LeafName("HD:My Best Years:1962:The Drive-In")
--puts The Drive-In into the message box.
put LeafName("Winkin:Blinkin:Nod") into theContainer
--puts Nod into theContainer
This XFCN used to be known as LastPathComponent, but that name is too long to type.
-- part contents for card part 1
----- text -----
UNIT LastPathComponent;
{ LeafName XFCN © 1988-1989 by the Trustees of Dartmouth College }
{ Written by Kevin Calhoun }
{ This source compatible with MPW Pascal 3.0 }
(*
Pascal LeafName.p
Link -m ENTRYPOINT Γêé
-o "YourFile" Γêé
-rt XFCN=3530 Γêé
-sn Main=LeafName Γêé
LeafName.p.o Γêé
"{PLibraries}"Paslib.o Γêé
"{Libraries}"HyperXLib.o
*)
{$R-}
INTERFACE
USES
Types,
HyperXCmd;
PROCEDURE EntryPoint (paramPtr : XCMDPtr);
IMPLEMENTATION
PROCEDURE GetLPC(paramPtr : XCMDPtr); FORWARD;
PROCEDURE EntryPoint (paramPtr : XCMDPtr);
BEGIN
GetLPC(paramPtr);
END;
PROCEDURE GetLPC (paramPtr : XCMDPtr);
VAR
fullPathName : Str255;
fileName : Str255;
FUNCTION AfterLastColon (str : Str255) : Str255;
VAR
theLength, index : INTEGER;
BEGIN
theLength := LENGTH(str);
index := theLength;
IF POS(':', str) > 0 THEN
BEGIN
WHILE (str[index] <> ':') DO
BEGIN
index := index - 1;
END;
AfterLastColon := COPY(str, index + 1, theLength - index);